package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.CommonFailuresFallBack;
import cn.cs.pojo.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-order-provider", configuration = CsConfiguration.class, fallback = CommonFailuresFallBack.class)
public interface CommonFailuresClient {

    @RequestMapping(value = "/getCommonFailuresById", method = RequestMethod.POST)
    public CommonFailures getCommonFailuresById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getCommonFailuresListByMap", method = RequestMethod.POST)
    public List<CommonFailures> getCommonFailuresListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getCommonFailuresCountByMap", method = RequestMethod.POST)
    public Integer getCommonFailuresCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addCommonFailures", method = RequestMethod.POST)
    public Integer addCommonFailures(@RequestBody CommonFailures commonFailures) throws Exception;

    @RequestMapping(value = "/modifyCommonFailures", method = RequestMethod.POST)
    public Integer modifyCommonFailures(@RequestBody CommonFailures commonFailures) throws Exception;

    @RequestMapping(value = "/deleteCommonFailuresById", method = RequestMethod.POST)
    public Integer deleteCommonFailuresById(@RequestParam("id") String id) throws Exception;

}
